<style>
/* 我的小店 */
.myshop-header {border-radius:0.5rem;background:#fff;padding:0.5rem 0.8rem}
.myshop-header .shoplogo {height: 3.5rem; width: 3.5rem; background: #fff; position: absolute; top: 3.5rem; right: 0.8rem; border: 1px solid #eee;border-radius: .2rem}
.myshop-header .shoplogo img {height: 100%; width: 100%; display: block;border-radius: .2rem}
.myshop-header .menus {height: auto; background: #fff;}
.myshop-header .menus .nav {height: auto; width: 1%; padding: 0.5rem 0; margin: 0; font-size: 0.7rem; color: #636363; text-align: center; display: table-cell;position: relative;}
.myshop-header .menus .nav:after  {font-size: 0.7rem;position: absolute;content: '';left:-1px;top:0.5rem;bottom:0.5rem;border-left:0 solid #d9d9d9;}
    .btn.btn-default-o{
        border-radius: 0.6rem;
        line-height: 0.3rem;
        height: 0.8rem;
        padding: 0 0.3rem;
        font-size: .5rem;
    }
    .towline{
        color: #000;
        font-size: 0.7rem;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        white-space: normal;
    }
    .fui-list-inner .text{
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;
        font-size: .7rem;
        color: #000;
    }
    .goods-selected .fui-list-inner{
        height: 4rem;
        display: -webkit-box;
        display: -webkit-flex;
        display: flex;
        flex-direction: column;
        -webkit-flex-direction: column;
        justify-content: space-between;
        -webkit-justify-content: space-between;
    }
.fe-floatright-bottom a {
    display: block;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 100%;
    background-color: #ff9999;
    color: #fff;
    line-height: 0.7rem;
	font-size:0.45rem;
    margin: 0.5rem auto;
    margin-right: 0;
}
.fe-floatright-bottom a .icon {
    color: #fff;
    font-size: 0.6rem;
    height: 0.6rem;
	line-height: 1rem;
    opacity: 1;
}
.cartmode{
	bottom: 2.5rem
}
.cartmode-backpage{
	bottom: 4.3rem
}
.fui-number .minus:before, .fui-number .plus:before {
	border-left: 0 solid #d9d9d9;
}
.fui-number .minus:after, .fui-number .plus:after {
	border-right: 0 solid #d9d9d9;
}
.fui-number:before {
	border-top: 0 solid #d9d9d9;
}
.fui-number:after {border-top: 0 solid #d9d9d9;}
.fui-number .num {
	color:#666;
}
.fui-number .num {
	color:#666;
}
.fui-number.small {
	height: 1.2rem;
	width: auto;
	line-height: 1.2rem;
}
.fui-number .minus, .fui-number .plus {
	z-index:0;
}
.fui-number.small .minus{
	color: red;
	padding-top:1px;
	border: 1px solid red;
	border-radius:50%;
}
 .fui-number.small .plus {
	color: #fff;
	padding-top:1px;
	background: red;
	border: 1px solid red;
	border-radius:50%;
}
.fui-footer.quick {
    background: {{main.syscolor||'#db232b'}};
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    z-index: 30;
}
.fui-footer.quick .quick-cart {
    width: 3.6rem;
    position: relative;
}
.fui-footer.quick .quick-cart.an {
    animation: cartan 0.5s;
}
@keyframes cartan {
    0% {
        transform: scale(0.8);
        -ms-transform: scale(0.8);
        -webkit-transform:scale(0.8);
        -o-transform: scale(0.8);
        -moz-transform: scale(0.8);
    }
    25% {
        transform:scale(1.1);
        -ms-transform: scale(1.1);
        -webkit-transform:scale(1.1);
        -o-transform: scale(1.1);
        -moz-transform: scale(1.1);
    }
    50% {
        transform:scale(0.9);
        -ms-transform: scale(0.9);
        -webkit-transform:scale(0.9);
        -o-transform: scale(0.9);
        -moz-transform: scale(0.9);
    }
    100% {
        transform:scale(1);
        -ms-transform: scale(1);
        -webkit-transform:scale(1);
        -o-transform: scale(1);
        -moz-transform: scale(1);
    }
}
.fui-footer.quick .quick-cart .dot {
    background: #f60;
    border-radius: 0.5rem;
    color: #fff;
    font-size: 0.6rem;
    height: 0.8rem;
    line-height: 0.8rem;
    margin-left: 0.1rem;
    min-width: 0.8rem;
    padding: 0 0.2rem;
    position: absolute;
    top: 0.2rem;
    right: 0;
    vertical-align: top;
    text-align: center;
    z-index: 11;
    display: none;
}
.fui-footer.quick .quick-cart .inner {
    height: 3rem;
    width: 3rem;
    border-radius: 3rem;
    background: {{main.syscolor||'#db232b'}};
    border: 0.25rem solid #4d4d4d;
    color: #fff;
    text-align: center;
    line-height: 2.6rem;
    position: absolute;
    right: 0;
    bottom: 0.26rem;
    z-index: 10;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
    -webkit-box-shadow: 0 0 4px rgba(0,0,0,0.3);
    -moz-box-shadow: 0 0 4px rgba(0,0,0,0.3);
}
.fui-footer.quick .quick-cart .inner .icon {
    font-size: 1.4rem;
}
.fui-footer.quick .quick-cart.empty .inner {
    background: #404040;
    color: #67676b;
}
.fui-footer.quick .quick-info {
    width: 100%;
    padding: 0.3rem 0.4rem;
    line-height: 2.5rem;
    font-size: 0.65rem;
    color: #fff;
	border-right:2px solid #fff;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
}
.fui-footer.quick .quick-info .price {
    font-size: 1.3rem;
    line-height: 1.6rem;
}
.fui-footer.quick .quick-submit {
    height: 2.5rem;
    padding: 0 1.2rem;
    line-height: 2.5rem;
    color: #fff;
    display: inline-block;
}
.fui-footer.quick .quick-submit.disabled {
    background: #fff;
}
/* Number选择器 */
.quick-num {
    height: 1.1rem;
    width: auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
}
.quick-num.open .minus {
    -moz-transition-duration: 300ms;
    -webkit-transition-duration: 300ms;
    transition-duration: 300ms;
    -webkit-transform: translate3d(0, 0, 0) rotate(0deg);
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 1;
}
.quick-num.open .num {
    -moz-transition-duration: 300ms;
    -webkit-transition-duration: 300ms;
    transition-duration: 300ms;
    opacity: 1;
}
.quick-num.close .minus {
    animation: closeminus 0.2s;
    animation-fill-mode : forwards;
}
.quick-num.close .num {
    -moz-transition-duration: 100ms;
    -webkit-transition-duration: 100ms;
    transition-duration: 100ms;
    opacity: 0;
}
@keyframes closeminus {
    20% {
        -webkit-transform: translate3d(50%, 0, 0) rotate(0deg);
        transform: translate3d(50%, 0, 0) rotate(0deg);
        opacity: 1;
    }
    50% {
        -webkit-transform: translate3d(100%, 0, 0) rotate(30deg);
        transform: translate3d(100%, 0, 0) rotate(30deg);
        opacity: 0.5;
    }
    70% {
        -webkit-transform: translate3d(150%, 0, 0) rotate(60deg);
        transform: translate3d(150%, 0, 0) rotate(60deg);
        opacity: 0.3;
    }
    80% {
        -webkit-transform: translate3d(200%, 0, 0) rotate(90deg);
        transform: translate3d(200%, 0, 0) rotate(90deg);
        opacity: 0.2;
    }
    100% {
        opacity: 0;
    }
}
.quick-num .minus,
.quick-num .plus {
    height: 1.2rem;
    width: 1.2rem;
    line-height: 1.2rem;
    font-size: 1.2rem;
    text-align: center;
    border-radius: 2rem;
}
.quick-num .minus {
    color: {{main.syscolor||'red'}};
    border: 1px solid {{main.syscolor||'red'}};
    -webkit-transform: translate3d(200%, 0, 0) rotate(90deg);
    transform: translate3d(200%, 0, 0) rotate(90deg);
    -webkit-transition-property: -webkit-transform;
    transition-property: transform;
    background: #fff;
    opacity: 0;
    position: relative;
    z-index: 8;
}
.quick-num .minus.disabled {
    color: #dadada;
    border-color: #dadada;
}
.quick-num .plus {
    background: {{main.syscolor||'red'}};
    color: #fff;
    position: relative;
    z-index: 11;
}
.quick-num .plus.disabled {
    background: #dadada;
}
.quick-num .num {
    height: 1.2rem;
    line-height: 1.2rem;
    font-size: 0.85rem;
    min-width: 1.2rem;
    padding: 0 0.2rem;
    text-align: center;
    color: #fff;
    opacity: 0;
}
.fui-searchbar:after {
	height: 0;
}
.fui-goods-item .detail .price {
   height:1.2rem;
}
</style>
<div class="fui-page fui-page-current page-commission-myshop" ng-if="pagedata.op=='main'">
    <div class='fui-content'>
	<div class="fe-floatback" style="left: 4px;">
			<a href="javascript:void(0);" ng-click="goback()">
				<i class="icon icon-back bold" style="font-size:1rem;"></i>
			</a>
		</div>
		<div class="fe-floatback bold" style="position: absolute;width: 8rem;padding:0.3rem 0.2rem;left:50%;margin-left:-4rem;height:1.6rem;border-radius:1.6rem;background-color: #fde24d;color: #000;line-height: 0.8rem;opacity: 0.6;">
			<div class="overflow-h" style="width:7.6rem;line-height:0.6rem;font-size:0.5rem;"><i class="icon icon-position" style="font-size:0.4rem"></i> {{pagedata.merch.address || '未定义店铺address'}}</div>
			<div style="line-height:0.6rem;font-size:0.5rem">{{pagedata.merch.merchname || '未定义店铺名称'}}</div>
		</div>
		<div style="width:100%;height:5rem;background:url({{tomedia(pagedata.merch.topimg) || '../addons/jy_weishop/resource/images/myshoptop.jpg'}});no-repeat 50%;background-size: cover;background-position:top center;">
		</div>
		<div class="myshop-header" style="margin-top:-1rem;padding-top:0.2rem">
					<div class="title bold" style="width:100%;font-size:1.3rem">{{pagedata.merch.merchname || '平台proprietary'}}</div>
					<div class="subtitle">
								<div class="store-moneylimit">
									<i class="icon icon-shoucang-tianchong yellow" style="font-size:0.6rem"> {{pagedata.merch.star || '5.0'}}</i>
									<span style="margin-left:0.2rem"> 销量 {{pagedata.merch.salenum || 0}}</span>
									<span ng-if="pagedata.merch.out_juli>=pagedata.merch.juli" class="store-distance">{{pagedata.merch.juli || 0}}km | 约{{pagedata.merch.peisongtime || 50}}分钟</span>
									<span ng-if="pagedata.merch.out_juli<pagedata.merch.juli" class="store-distance"><span class="yellow">超出</span>配送范围({{pagedata.merch.out_juli}}km)</span></span>
								</div>
					</div>
					<div class="subtitle" style="font-size:0.55rem">
								<div class="jylabel jylabel-red" style="">{{pagedata.merch.tags}}</div>
					</div>
					<div ng-repeat="c in pagedata.merch.coupons" class="jylabel jylabel-red" style="background:#f60;color:#fff;margin-right:0.2rem">{{c.title}}</div>
					<div class="subtitle" style="font-size:0.55rem">
							简介：{{pagedata.merch.desc || '暂无店铺描述'}}
					</div>
					<div class="shoplogo">
							<img ng-src="{{tomedia(pagedata.merch.logo) || '../core/resource/images/nopic.jpg'}}"  />
					</div>
					<div class="menus">
					<div ng-click="post({merchid:pagedata.merch.id},'jy_merch/myshop/like/')" class="nav btn-favorite">
						<span>{{pagedata.merch.islike?'已收藏':'收藏本店'}}</span>
						<span><i ng-class="{'icon icon-xiai':pagedata.merch.islike,'icon icon-pinpai':!pagedata.merch.islike}"></i></span>
					</div>
					<div ng-if="pagedata.merch.iskefu!=1" ng-click="pagedata.tel()" class="nav btn-favorite">
						<span>联系Customer service</span>
						<span><i  class="icon icon-phone"></i></span>
					</div>
					<div ng-if="pagedata.merch.iskefu==1" ng-click="access_json('jy_kefu/home//p=jy_merch&pid='+pagedata.merch.id)" class="nav btn-favorite">
						<span>联系Customer service</span>
						<span><i class="icon icon-kefu"></i></span>
					</div>
					<div class="nav btn-qrcode"  ng-click="access_json('jy_merch/qrcode//id='+pagedata.merch.id)">
						<span>二维码</span>
						<span><i class="icon icon-qrcode"></i></span>
					</div>
					</div>
	</div>
	<div class="fui-searchbar">
	    <div class="searchbar center">
		<div class="search-input">
			<i id="searchsub" class="fa fa-search" ng-click="pagedata.get_list(1)"></i>
		    <input type="search" ng-model="pagedata.params.keyword" class="search" placeholder="Input a keyword...">
		</div>
	    </div>
	</div>
	 <div class="fixed-title">
							 <span class="befirst spacing">
								 <span class="icon icon-icon-xiexiantiao" style="color:#efadb0"></span>
								 <span class="icon icon-icon-xiexiantiao" style="color:#e26d71"></span>
								 <span class="icon icon-icon-xiexiantiao" style="color:#d62f35"></span>
							 </span> 
							 <span class="title-text">小店Goods</span> 
							 <span class="spacing">
								 <span class="icon icon-icon-xiexiantiao" style="color:#d62f35"></span>
								 <span class="icon icon-icon-xiexiantiao" style="color:#e26d71"></span>
								 <span class="icon icon-icon-xiexiantiao" style="color:#efadb0"></span>
							 </span>
	</div>
	<div class="fui-goods-group block" id='container'>
	<div ng-repeat="g in pagedata.list" id="goodslist" class="fui-goods-item">
					<a ng-click="access_json('jy_weishop_en/goods.detail//merchid='+pagedata.merch.id+'&id='+g.id)">
						<div class="image" style="background-image:url({{tomedia(g.image) || '../core/resource/images/nopic.jpg'}})">
							<div ng-if="g.total<=0" class="salez" style="background-image: url({{tomedia(pagedata.shopset.saleout)}}); "></div>
						</div>
					</a>
					<div class="detail">
						<a ng-click="access_json('jy_weishop_en/goods.detail//merchid='+pagedata.merch.id+'&id='+g.id)">
							<div class="name">{{g.title}}</div>
						</a>
						<div class="price">
							<span class="text">${{g.price}}</span>
							<span ng-if="(!g.specs_list||g.specs_list.length < 1) && g.total>0" class="fui-number small" style="right:0">
											<span ng-if="g.carttotal>0" class="minus" ng-click="pagedata.minus($index)"><i class="icon icon-subtract" style="font-size:0.7rem"></i></span>
											<input ng-if="g.carttotal>0" class="num shownum" type="text" ng-model="g.carttotal" style="width:1rem" ng-change="pagedata.refresh()"/>
											<span class="plus" ng-click="pagedata.plus($index)"><i class="icon icon-tianjia" style="font-size:0.7rem"></i></span>
							</span>
							<span ng-show="g.specs_list.length < 1 && g.total==0" class="disabled" style="padding-right:0.2rem;">Sold馨</span>
							<span ng-show="g.specs_list.length > 0" class="btn btn-sm btn-danger-o order-finish" style="line-height:1.8" onclick="$('#selecttaocan').modal();" ng-click="pagedata.g=g;pagedata.nowgkey=$index;" >选规格</span>
							<span ng-show="g.specs_list.length > 0 && g.carttotal" class="dot" style="display: block;">{{g.carttotal}}</span>
						</div>
					</div>
	</div>
	</div>
	<div ng-if="pagedata.loading" class='infinite-loading' style="text-align: center; color: #666;">
		<span class='fui-preloader'></span>
		<span class='text'> Loading...</span>
	</div>
	
	<div ng-include="sys_html('_copyright')"></div>
    </div>
	<div id='cover' ng-if="showcover ==1">
			<div class='fui-mask-m visible'></div>
			<div class='arrow'></div>
			<div class='content'>Please click on the top right corner<br/>通过【收藏】<br/>方便下次浏览</div>
	</div>
	<div ng-if="pagedata.list.length<1" style="text-align: center; color: #666;">
		<span class="text"> 暂无Goods</span>
	</div>
	<div ng-include="sys_html('common/pluginnav',true)"></div>
</div>
<div class="fui-page fui-page-current page-commission-myshop" ng-if="pagedata.op=='addgoods'">
    <div class='fui-content navbar'>
		<div class="weui_cells weui_cells_form">
			<div class="weui_cell">
				<div class="weui_cell_hd"><label class="weui_label">Goods标题</label></div>
				<div class="weui_cell_bd weui_cell_primary">
					<input class="weui_input" type="text" ng-model="pagedata.item.title" placeholder="输入Goods标题">
				</div>
			</div>
			<div class="weui_cell">
				<div class="weui_cell_hd"><label class="weui_label">Goods描述</label></div>
				<div class="weui_cell_bd weui_cell_primary">
					<input class="weui_input" type="text" ng-model="pagedata.item.subtitle" placeholder="输入Goods描述">
				</div>
			</div>
			<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">GoodsLOGO</label></div>
							<div class="weui_cell_bd weui_cell_primary">
								<ul class="weui_uploader_files" ng-if="pagedata.item.image">
									  <li class="weui_uploader_file" style="background-image:url({{tomedia(pagedata.item.image)}})"></li>
								</ul>
								<div class="weui_uploader_input_wrp">
									 <input class="weui_uploader_input" ng-model="pagedata.item.image" ng-click="image(pagedata.item,'image')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple="">
								</div>
							</div>
			</div>
			<div class="weui_cell">
				<div class="weui_cell_hd"><label class="weui_label">Goods单位</label></div>
				<div class="weui_cell_bd weui_cell_primary">
					<input class="weui_input" type="text" ng-model="pagedata.item.unit" placeholder="输入Goods单位">
				</div>
			</div>
			<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">Goods价格</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" type="text" ng-model="pagedata.item.price" placeholder="输入Goods价格">
						</div>
			</div>
			<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">Goods类型</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<select class="weui_select" ng-model="pagedata.item.type" name="type">
								<option ng-repeat="(k,t) in pagedata.types" value="{{k}}">{{t}}</option>
							</select>
						</div>
			</div>
			<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">GoodsTotal</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" type="text" ng-model="pagedata.item.total" placeholder="输入GoodsTotal">
						</div>
			</div>
			<div class="weui_cell">
						<div class="weui_cell_hd"><label class="weui_label">GoodsWeight</label></div>
						<div class="weui_cell_bd weui_cell_primary">
							<input class="weui_input" type="text" ng-model="pagedata.item.weight" placeholder="输入GoodsWeight（kg）">
						</div>
			</div>
		</div>
			<div class="weui_cells_title">Goods图片</div>
			<div class="weui_cells weui_cells_form">
					<div class="weui_cell">
						<div class="weui_cell_bd weui_cell_primary">
							<div class="weui_uploader">
								<div class="weui_uploader_bd">
									<ul class="weui_uploader_files">
										<li ng-repeat="p in pagedata.item.images track by $index" class="weui_uploader_file" style="background-image:url({{tomedia(p)}})">
											<div class="upbtn" >
												<a style="color:#f60" href="javascript:;" ng-click="pagedata.item.images.splice($index-1,0,p);pagedata.item.images.splice($index+1,1)">上移</a>
												<a style="color:#f60" href="javascript:;" ng-click="pagedata.item.images.splice($index,1)">删除</a>
											</div>
										</li>
									</ul>
									<div class="weui_uploader_input_wrp" href="javascript:;" ng-click="images(pagedata.item,'images')">
									</div>
								</div>
							</div>
						</div>
					</div>
			</div>
			<!--Goods规格-->
		<style>
		.btn {line-height:1.4rem}
		.input-group .form-control {min-width:1.2rem}
		</style>
		<div ng-init="checkobj(pagedata.item,'specs');checkarray(pagedata.item.specs,'specs');"></div>
		<div class="weui_cells spec_item" ng-repeat="spec in pagedata.item.specs.specs">
				<div class="weui_cell">
					<div class="weui_cell_hd">规格名称</div>
					<div class="weui_cell_bd weui_cell_primary">
						<div class="input-group">
							<input class="weui_input spec_title" type="text" ng-model="spec.title" placeholder="规格名称 (比如: 颜色)">
						</div>
					</div>
					<div class="weui_cell_ft">
								<button class="btn btn-warning add-specitem" ng-click="new_option={};spec.options.push(new_option)" type="button" style="margin-right:0"><i class="fa fa-plus"></i>规格项</button>
								<button class="btn btn-info" ng-click="pagedata.item.specs.specs.splice($index,1)" type="button" style="margin-left:0"><i class="fa fa-remove"></i></button>
					</div>
				</div>
				<div class="weui_cell">
					<div class="weui_cell_hd">规格Details</div>
					<div class="weui_cell_bd weui_cell_primary">
						<div class="spec_item_items">
							<div ng-repeat="option in spec.options" class="spec_item_item" style="float:left;margin:5px;width:5rem; position: relative">
								<div class="input-group">
									<input type="text" class="weui_input spec_item_title" style="margin:0" ng-model="option.title"/>
									<span class="input-group-addon">
										<a href="javascript:;" ng-click="spec.options.splice($index,1)" title='删除' style="color:#fff"><i class="fa fa-times"></i></a>
									</span>
								</div>
							</div>
						</div>
					</div>
				</div> 
		</div>
		<div class="weui_cell">
			<div class="weui_cell_hd">
					<button class="btn btn-primary" ng-click="new_spec={'title':'','options':[]};pagedata.item.specs.specs.push(new_spec);" type="button"><i class="fa fa-plus"></i> 添加规格</button>
					<button class="btn btn-info" ng-click="pagedata.item.specs.tds=func.spec_made()" type="button"><i class="fa fa-refresh"></i> 刷新规格项目表</button>
			</div>
		</div>
		<div class="tips tips-yellow">
			<i class="fa fa-bullhorn"></i> [<red>Warm prompt</red>]：Set 好后,务必刷新一次规格,才会生效！
		</div>
		<div class="clearfix table-responsive" ng-if="pagedata.item.specs.tds">
			<table class="table table-bordered table-condensed jinyun-table">
				<thead class="navbar-inner">
					<tr class="active">
						<th width="80px" style="text-align:center;" ng-repeat="spec in pagedata.item.specs.specs">{{spec.title}}</th>
						<th width="80px" style="text-align:center;">图片</th>
						<th>
							<div class="">
							<div style="text-align:center;">Total</div>
							<div class="input-group">
							<input type="text" class="form-control  input-sm option_stock_all valid" ng-model="pagedata.num">
							<span class="input-group-addon" ng-click="func.spec_set('num',pagedata.num)">
								<i class="fa fa-angle-double-down" title="批量Set "></i>
							</span>
							</div>
							</div>
						</th>
						<th>
							<div class="">
							<div style="text-align:center;">现价</div>
							<div class="input-group">
							<input type="text" class="form-control  input-sm option_stock_all valid" ng-model="pagedata.price">
							<span class="input-group-addon" ng-click="func.spec_set('price',pagedata.price)">
								<i class="fa fa-angle-double-down" title="批量Set "></i>
							</span>
							</div>
							</div>
						</th>
						<th>
							<div class="">
							<div style="text-align:center;">原价</div>
							<div class="input-group">
							<input type="text" class="form-control  input-sm option_stock_all valid" ng-model="pagedata.old_price">
							<span class="input-group-addon" ng-click="func.spec_set('old_price',pagedata.old_price)">
								<i class="fa fa-angle-double-down" title="批量Set "></i>
							</span>
							</div>
							</div>
						</th>
						<th>
							<div class="">
							<div style="text-align:center;">成本价</div>
							<div class="input-group">
							<input type="text" class="form-control  input-sm option_stock_all valid" ng-model="pagedata.cost_price">
							<span class="input-group-addon" ng-click="func.spec_set('cost_price',pagedata.cost_price)">
								<i class="fa fa-angle-double-down" title="批量Set "></i>
							</span>
							</div>
							</div>
						</th>
						<th>
							<div class="">
							<div style="text-align:center;">编码</div>
							<div class="input-group">
							<input type="text" class="form-control  input-sm option_stock_all valid" ng-model="pagedata.bm">
							<span class="input-group-addon" ng-click="func.spec_set('bm',pagedata.bm)">
								<i class="fa fa-angle-double-down" title="批量Set "></i>
							</span>
							</div>
							</div>
						</th>
						<th>
							<div class="">
							<div style="text-align:center;">条码</div>
							<div class="input-group">
							<input type="text" class="form-control  input-sm option_stock_all valid" ng-model="pagedata.tm">
							<span class="input-group-addon" ng-click="func.spec_set('tm',pagedata.tm)">
								<i class="fa fa-angle-double-down" title="批量Set "></i>
							</span>
							</div>
							</div>
						</th>
						<th>
							<div class="">
							<div style="text-align:center;">Weight</div>
							<div class="input-group">
							<input type="text" class="form-control  input-sm option_stock_all valid" ng-model="pagedata.weight">
							<span class="input-group-addon" ng-click="func.spec_set('weight',pagedata.weight)">
								<i class="fa fa-angle-double-down" title="批量Set "></i>
							</span>
							</div>
							</div>
						</th>
					</tr>
				</thead>
					<tr ng-repeat="(index,td) in pagedata.item.specs.tds">
						<td class="text-left full" style="text-align:center;"ng-repeat="(key,spec) in pagedata.item.specs.specs" ng-if="td[spec.title]!=pagedata.item.specs.tds[index-1][spec.title]" rowspan="{{pagedata.item.specs.specs[key+1].options.length || 1}}">
							{{td[spec.title]}}
						</td>
						<td style="text-align:center;" ng-click="image(td,'image')"><img ng-src="{{tomedia(td.image) || '../core/resource/images/nopic-small.jpg'}}" style="width:30px;height:30px;padding:1px;border:1px solid #ccc;"/></td>
						<td><input class="form-control option_stock option valid" type="text" ng-model="td.num"/></td>
						<td><input class="form-control option_stock option valid" type="text" ng-model="td.price"/></td>
						<td><input class="form-control option_stock option valid" type="text" ng-model="td.old_price"/></td>
						<td><input class="form-control option_stock option valid" type="text" ng-model="td.cost_price"/></td>
						<td><input class="form-control option_stock option valid" type="text" ng-model="td.bm"/></td>
						<td><input class="form-control option_stock option valid" type="text" ng-model="td.tm"/></td>
						<td><input class="form-control option_stock option valid" type="text" ng-model="td.weight"/></td>
					</tr>
			</table>
		</div>
		<script>
		window.scope.func.spec_set=function(key,value){
			$.each(window.scope.pagedata.item.specs.tds,function(index,td){
				td[key]=value;
			});
		}
		window.scope.func.spec_made=function(){
			//刷新规格项目表，如果只是增加规格项，则保留原有规格Goods，如何保留呢。两A问题：如何判断是仅改规格项？两A规格数据库都存有。如何保留原有规格Goods？生成tds后，遍历原tds，然后进行赋值
			var isnew=false;
			$.each(scope.pagedata.item.specs.specs,function(i,spec){
				if(!spec.id){
					isnew=true;
				}
			});
			if(!scope.pagedata.item.specs.tds || scope.pagedata.item.specs.tds.length<=0){
				isnew=true;
			}
			
			var tds=[{'num':0}];
			$.each(window.scope.pagedata.item.specs.specs,function(i,spec){
				var new_tds=[];
				$.each(tds,function(j,k){
					$.each(spec.options,function(l,m){
						var new_td=angular.copy(k);
						new_td[spec.title]=m.title;
						new_tds.push(new_td);
					});
					
				});
				tds=new_tds;
			});
			if(!isnew){
				$.each(tds,function(j,k){
					$.each(scope.pagedata.item.specs.tds,function(j_old,k_old){
						var like=true;
						$.each(scope.pagedata.item.specs.specs,function(i,spec){
							if(k[spec.title]!=k_old[spec.title]){
								like=false;
							}
						});
						if(like){
							tds[j]=angular.copy(k_old);;
						}
					});
				})
			}
			return tds;
		}
		</script>
		<div class="weui_btn_area">
			<a class="weui_btn weui_btn_primary" ng-click="post(pagedata.item,'addgoods')">提交</a>
		</div>
	</div>
</div>
<div class="fui-page fui-page-current page-commission-myshop" ng-if="pagedata.op=='set'">
    <div class='fui-content navbar'>
		<div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">Merch名称</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="merchname" placeholder="Merch名称" ng-model="pagedata.item.merchname"/></div>
            </div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">主营项目</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="salecate" placeholder="例如鞋帽, 化妆品等" ng-model="pagedata.item.salecate"/></div>
            </div>
            <div class="fui-cell ">
                <div class="fui-cell-label">简单介绍</div>
                <div  class="fui-cell-info"><textarea id="desc" ng-model="pagedata.item.desc" placeholder="简单介绍下Merch"></textarea></div>
            </div>
			<div class='fui-cell'>
				<div class='fui-cell-label'>图标logo</div>
				<div class="fui-list jump">
					<a class="fui-list-media" ng-if="pagedata.item.logo">
						<img class="round" ng-src="{{tomedia(pagedata.item.logo) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					<a class="fui-list-media weui_uploader_input_wrp">
						<span class="weui_uploader_input" ng-click="image(pagedata.item,'logo')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple=""></span>
					</a>
				</div>
			</div>
			<div class='fui-cell' >
				<div class='fui-cell-label'>店招顶部图片</div>
				<div class="fui-list jump">
					<a class="fui-list-media" ng-if="pagedata.item.topimg">
						<img class="round" ng-src="{{tomedia(pagedata.item.topimg) || '../core/resource/images/nopic.jpg'}}" />
					</a>
					<a class="fui-list-media weui_uploader_input_wrp">
						<span class="weui_uploader_input" ng-click="image(pagedata.item,'topimg')" accept="image/jpg,image/jpeg,image/png,image/gif" multiple=""></span>
					</a>
				</div>
			</div>
        </div>
        <div class="fui-cell-group">
            <div class="fui-cell must ">
                <div class="fui-cell-label">The contact</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="realname" placeholder="您的称呼" ng-model="pagedata.item.realname"></div>
            </div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">Mobile号</div>
                <div class="fui-cell-info"><input type="tel" class="fui-input" id="mobile" placeholder="您的Mobile号" ng-model="pagedata.item.mobile"/></div>
            </div>
            <div class="fui-cell-tip">请仔细填写联系方式，保证我们能尽快联系到您~</div>
            <div class="fui-cell must ">
                <div class="fui-cell-label">店铺address</div>
                <div class="fui-cell-info"><input type="text" class="fui-input" id="address" placeholder="店铺address" ng-model="pagedata.item.address"></div>
				<div class="fui-cell-remark" ng-click="tool.choose_location(pagedata.item,'address','address')"><i class="icon jinyunicon icon-ditu"></i></div>
			</div>
            <label class="col-xs-12 col-sm-3 col-md-2 left-label" style="padding: 0.75rem 0.6rem 0.65rem;">选择坐标</label>
			<div class="col-xs-12 col-sm-8 col-lg-9">
						<div class="row row-fix"  style="padding-bottom:1rem">
							<div class="col-xs-4 col-sm-4">
								<input type="text" ng-model="pagedata.item.lat_lng.lng" placeholder="经度"  class="form-control" />
							</div>
							<div class="col-xs-4 col-sm-4">
								<input type="text" ng-model="pagedata.item.lat_lng.lat" placeholder="纬度"  class="form-control" />
							</div>
							<div class="col-xs-4 col-sm-4">
								<a ng-click="tool.choose_location(pagedata.item,'lat_lng','lat_lng')" class="btn btn-default btn-default-o btn-sm" style="height:1.2rem;padding:0.4rem 0.3rem" type="button">选择坐标</a>
							</div>
						</div>
			</div>
        </div>
		<div class="fui-cell-group weui_cell_switch">
			<div class="fui-cell">
                <div class="fui-cell-label">开启Customer service</div>
                <div class="fui-cell-info weui_cell_ft">
					<input type="checkbox" class="weui_switch" ng-checked="pagedata.item.iskefu" ng-model="pagedata.item.iskefu">
				</div>
            </div>
			<div class="fui-cell-tip">开启Customer service后，会进入Customer service界面，没开启，点击拨打Customer service电话！</div>
		</div>
		<div class="fui-cell-group weui_cell_switch">
			<div class="fui-cell">
                <div class="fui-cell-label">支持分销</div>
                <div class="fui-cell-info weui_cell_ft">
					<input type="checkbox" class="weui_switch" ng-checked="pagedata.item.iscommission" ng-model="pagedata.item.iscommission">
				</div>
            </div>
			<div class="fui-cell-tip">支持分销后，别的Merch，可以选择添加您的Goods到自己的小店，客户购买后享受佣金（佣金比例跟《微客分销》参数保持一致）！</div>
		</div>
		<div class="fui-cell-group weui_cell_switch">
			<div class="fui-cell">
                <div class="fui-cell-label">可被复制</div>
                <div class="fui-cell-info weui_cell_ft">
					<input type="checkbox" class="weui_switch" ng-checked="pagedata.item.is_share" ng-model="pagedata.item.is_share">
				</div>
            </div>
			<div class="fui-cell-tip">开启可复制后,他人可以一键复制你的店铺Goods,店铺LOGO,描述等！</div>
		</div>
		<div class="weui_btn_area">
			<a class="weui_btn weui_btn_primary" ng-click="post(pagedata.item,'set')">提交</a>
		</div>
	</div>
</div>
<div ng-if="pagedata.op=='setgoods'" class="fui-page fui-page page-commission-selectgoods" id="myshop-select-goods">
    <div class="fui-content navbar">
	<div class="fui-fullHigh-group" >
        <div class="fui-fullHigh-item menu" id="tab">
            <nav ng-class="{'on':pagedata.ctype =='all'}" ng-click="pagedata.get_list('all',0)">AllGoods</nav>
			<nav ng-class="{'on':pagedata.ctype =='isnew'}" ng-click="pagedata.get_list('isnew',0)">新上宝贝</nav>
			<nav ng-class="{'on':pagedata.ctype =='isrecommand'}" ng-click="pagedata.get_list('isrecommand',0)">Recommended宝贝</nav>
			<div ng-repeat="c1 in pagedata.category">
				<nav ng-class="{'on':pagedata.ctype ==c1.id}" ng-click="pagedata.get_list('',c1.id)" ng-show="!c1.enabled && pagedata.shopset.category.level !='-1'">{{c1.title}}</nav>
				<div ng-repeat="c2 in pagedata.category.childs[c1.id]">
					<nav ng-class="{'on':pagedata.ctype ==c2.id}" ng-click="pagedata.get_list('',c2.id)" ng-show="!c2.enabled && pagedata.shopset.category.level>=2">{{c2.title}}</nav>
					<nav ng-repeat="c3 in pagedata.category.childs[c2.id]" ng-class="{'on':pagedata.ctype ==c3.id}" ng-click="pagedata.get_list('',c3.id)" ng-show="!c3.enabled && pagedata.shopset.category.level>=3">{{c3.title}}</nav>
				</div>
			</div>
        </div>
        <div class="fui-fullHigh-item container">
              <div class="searchbar" style='margin:0;padding:0'>
                    <div class="search-input">
                        <i class="icon icon-search" ng-click="pagedata.get_list('all')"></i>
                        <input type="search" id='keywords' ng-model="pagedata.params.keyword" placeholder="Input a keyword..." style="border: 1px solid #f7f7f7;">
                    </div>
              </div>
				<p ng-if="pagedata.list.length<1" class="text-center text-cancel empty" style="margin-top:2rem;color:#999">Temporarily do not have anyGoods</p>
				<div class="fui-list-group goods-list-group" style="margin-top:0;">
					<div ng-repeat="g in pagedata.list" class="fui-list goods-item">
							<div ng-if="!pagedata.copy_merchid" class="fui-list-media" ng-click="access_json('/merch/addgoods/id='+g.id);">
								<img ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}" class='round'/>
							</div>
							<div ng-if="pagedata.copy_merchid" class="fui-list-media">
								<img ng-src="{{tomedia(g.image) || '../core/resource/images/nopic.jpg'}}" class='round'/>
							</div>
							<div class='fui-list-inner'>
								<div class='subtitle'>
									<span>{{g.title}}</span>
									<input ng-if="!pagedata.copy_merchid || pagedata.copy_merchid==0" type="checkbox" value="{{g.id}}" ng-checked="g.status==1" ng-click="pagedata.setstatus(g.id)" class="fui-switch fui-switch-warning fui-switch-small r-f"/>
								</div>
								<div class='text'>
									<span class='text-danger'>${{g.price}}</span>
									<div ng-if="!pagedata.copy_merchid || pagedata.copy_merchid==0" class="btn btn-sm btn-default-o order-delete r-f" style="padding:0.2rem;margin-top:0.3rem" href="javascript:;" ng-click="post({'id':g.id},'delgoods','','','Determine删除？')">删除Goods</div>
									<div ng-if="pagedata.copy_merchid>0" class="btn btn-sm btn-default-o order-delete r-f" style="padding:0.2rem;margin-top:0.3rem" href="javascript:;" ng-click="post({'id':g.id},'up_goods','','','Determine复制？')">复制Goods</div>
									<div ng-if="pagedata.sale>0" class="btn btn-sm btn-default-o order-delete r-f" style="padding:0.2rem;margin-top:0.3rem" href="javascript:;" ng-click="post({'id':g.id},'sale_goods','','','Determine该代销Goods？')">代销Goods</div>
								</div>
								
							</div>
							
					</div>
				</div>
				<div ng-if="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span class='text'> Loading...</span></div>
        </div> 
    </div>
</div>
</div>
<div ng-if="pagedata.isme==1" class="fe-floatright-bottom right" style="bottom:60px;">
			<a href="javascript:;" style="background-color: #ff6666;" ng-click="toogle(pagedata,'show_shopset',[1,0])">
				<i ng-class="{'icon':1,'icon-less':pagedata.show_shopset !=1,'icon-moreunfold':pagedata.show_shopset ==1}" style="font-size:0.8rem;"></i>
				<div style="line-height:0.3rem">{{pagedata.show_shopset !=1?'Set ':'Shut down'}}</div>
			</a>
	</div>
	<div ng-if="pagedata.isme!=1" class="fe-floatright-bottom right" style="bottom:3rem;">
			<a href="javascript:;" style="background-color: #ff6666;" ng-click="access_json('jy_weishop_en/merch/')">
				<i class="icon icon-dianpu" style="font-size:0.8rem;"></i>
				<div style="line-height:0.3rem">我的</div>
			</a>
	</div>
	<div ng-if="pagedata.isme!=1 && (pagedata.merch.is_share=='1' || pagedata.merch.iscommission=='1')" class="fe-floatright-bottom right" style="bottom:6rem;">
			<a href="javascript:;" style="background-color: #ff6666;" ng-click="post({},'copy_merch','','','确认复制他的店铺吗？复制后，你的店铺描述，LOGO会变成复制的')">
				<div style="line-height:0.6rem;width:1.22rem;height:1.22rem;margin:auto;padding-top:0.25rem">复制店铺</div>
			</a>
			<a ng-if="pagedata.merch.is_share=='1'" href="javascript:;" style="background-color: #ff6666;" ng-click="access_json('jy_weishop_en/merch/setgoods/merchid='+pagedata.merch.id)">
				<div style="line-height:0.6rem;width:1.22rem;height:1.22rem;margin:auto;padding-top:0.25rem">复制Goods</div>
			</a>
			<a ng-if="pagedata.merch.iscommission=='1'" href="javascript:;" style="background-color: #ff6666;" ng-click="access_json('jy_weishop_en/merch/setgoods/sale=1&merchid='+pagedata.merch.id)">
				<div style="line-height:0.6rem;width:1.22rem;height:1.22rem;margin:auto;padding-top:0.25rem">代销Goods</div>
			</a>
	</div>
	<div ng-if="pagedata.show_shopset && pagedata.isme==1" class="fe-floatright-bottom right" style="bottom:6.6rem;">
		<a ng-click="access_json('jy_weishop_en/merch/main/myshop=1')">
				<i class="icon icon-shouye"></i>
				<div style="line-height:0.3rem">Home</div>
		</a>
		<a ng-click="access_json('jy_merch/manage.index/')" class="nav-item">
			<i class="icon icon-set"></i>
			<div style="line-height:0.3rem">管理</div>
		</a>
		<a ng-click="access_json('jy_weishop_en/merch/set/')" class="nav-item">
			<i class="icon icon-set"></i>
			<div style="line-height:0.3rem">Set </div>
		</a>
		<a ng-click="access_json('jy_weishop_en/merch/setgoods/')" class="nav-item">
			<i class="icon icon-liebiao"></i>
			<div style="line-height:0.3rem">Goods</div>
		</a>
		<a href="javascript:;" ng-click="access_json('jy_weishop_en/merch/addgoods/')" class="nav-item">
			<i class="icon icon-tianjia"></i>
			<div style="line-height:0.3rem">添加</div>
		</a>
		<a href="javascript:;" ng-click="access_json('jy_kefu/mychat//p=jy_merch&pid='+pagedata.merch.id)" class="nav-item">
			<i class="icon icon-kefu"></i>
			<div style="line-height:0.3rem">Customer service</div>
		</a>
	</div>
<div ng-include="sys_html('goods/_modalpicker')"></div>
<script>
scope.pagedata.tel=function(){
	window.location.href = 'tel:' + scope.pagedata.merch.mobile;
}
scope.pagedata.setstatus=function(goodsid){
	scope.post_json('jy_weishop_en/merch/setstatus/',{'id':goodsid},function(res){
	
		
	});
}
scope.pagedata.get_list=function(order,cid){
	if(order){
		scope.pagedata.loaded = false
		scope.pagedata.params.page=1;
		scope.pagedata.list=[];
		scope.pagedata.params.order=order;
		scope.pagedata.ctype =order
		scope.pagedata.params.cid='';
	}else if(cid){
		scope.pagedata.loaded = false
		scope.pagedata.params.page=1;
		scope.pagedata.params.cid=cid;
		scope.pagedata.params.order='';
		scope.pagedata.list =[];
		scope.pagedata.ctype =cid
	}else if(scope.pagedata.loaded){
		return;
	}
	if(scope.pagedata.op =='setgoods'){
		scope.pagedata.params.setgoods=1;
	}
	$('#loading_show').show();
	var query=scope.made_query(scope.pagedata.params);
	scope.get('jy_weishop_en/merch/list/'+query,function(res){
		scope.pagedata.loading=false;
		$('#loading_show').hide();
		if(res=='none'){
			scope.pagedata.loaded=true;
			return;
		}
		if(!Array.isArray(res)){
			scope.message('获取数据失败！');
			return;
		}
		if(res.length<scope.pagedata.psize){
			scope.pagedata.loaded=true;
		}
		if(!scope.pagedata.list){
			scope.pagedata.list=[];
		}
		res.forEach(function(row){
			scope.pagedata.list.push(row);
		});
		scope.pagedata.params.page++;
		
	});
}
if(scope.pagedata.op =='main' || scope.pagedata.op =='setgoods'){
	scope.pagedata.loading=true;
	scope.pagedata.ctype ='all';
	scope.pagedata.scroll_bottom=function(){
		scope.pagedata.get_list();
	}
	if(scope.pagedata.op =='setgoods'){
		scope.pagedata.get_list('all');
	}else{
		scope.pagedata.get_list(1);
	}
	
}
//刷新总数和总价
scope.pagedata.refresh=function(){
	scope.pagedata.showprice=scope.price(scope.pagedata.totalprice);
	scope.$evalAsync();
}
//减少
scope.pagedata.minus=function(index){
	var g = scope.pagedata.list[index]
	if(g.carttotal<=0){
		return false;
	}
	scope.post_json('jy_weishop_en/member.cart/minus/',{'merchid':scope.pagedata.merch.id,'getlist':true,'id':g.cartid},function(res){
			g.carttotal--;
			scope.pagedata.list[index]=g
			scope.pagedata.refresh();
			
	});
}
//增加
scope.pagedata.plus=function(index){
	var g = scope.pagedata.list[index]
	g.optionid=0;
	if(g.carttotal>=g.total){
			scope.message('不能再添加了，已超过Total！','error');
			return false;
	}
	scope.post_json('jy_weishop_en/member.cart/addtocart/',{'merchid':scope.pagedata.merch.id,'getlist':true,'goodsid':g.id,'optionid':g.optionid},function(res){
			g.carttotal++;
			if(res!='success'){
				g.cartid=res.cartid;
				scope.pagedata.carts=res.list
			}
			scope.pagedata.list[index]=g
			scope.pagedata.refresh();
	});
}
//减少
scope.pagedata.sp_minus=function(){
	var g =scope.pagedata.g;
	if(g.carttotal<=0){
		return false;
	}
	scope.post_json('jy_weishop_en/member.cart/minus/',{'getlist':true,'id':g.cartid,'optionid':g.options.id},function(res){
			g.carttotal--;
			if(g.post[g.options.id].num<=0){
				return false;
			}
			scope.pagedata.carts=res.list
			g.post[g.options.id].num--;
			scope.pagedata.list[scope.pagedata.nowgkey]=g
			scope.pagedata.refresh();
			
	});
}
//增加
scope.pagedata.sp_plus=function(){
	var g =scope.pagedata.g;
	if(g.carttotal>=g.options.stock){
		scope.message('不能再添加了，已超过Total！','error');
		return false;
	}
	scope.post_json('jy_weishop_en/member.cart/addtocart/',{'getlist':true,'goodsid':g.id,'optionid':g.options.id},function(res){
			
			g.carttotal++;
			g.post[g.options.id].num++;
			if(res!='success'){
				g.cartid=res.id;
			}
			scope.pagedata.list[scope.pagedata.nowgkey]=g
			scope.pagedata.refresh();
	});
}
//选择
scope.pagedata.get_optionsid=function(){
	var specid = scope.pagedata.g.specid;
	specid = specid.join('_');
	scope.post_json('jy_weishop_en/goods.detail/get_optionsid/',{'goodsid':scope.pagedata.g.id,'specid':specid},function(res){
			var optionsid=res.options.id;
			scope.pagedata.g.options=res.options;
			scope.pagedata.g.selespename=res.selespename;
			if(!scope.pagedata.g.post[optionsid]){
				scope.pagedata.g.post[optionsid]={}
				scope.pagedata.g.post[optionsid]={
					'num':scope.pagedata.g.post[optionsid].num?scope.pagedata.g.post[optionsid].num:res.carttotal,
					'title':res.selespename,
				}
			}
			
			scope.$evalAsync();
	});
}
//Mobile软键盘--Search 
$("body").keydown(function() {
    if (event.keyCode == "13") {
        $('#searchsub').click();
    }
});
</script>